var viewPathRoot = "../.."
var viewAcademicWarningPath = "/business/academicWarning/academicWarning.jsp"


window.onresize = function () {


    var W = document.documentElement.clientWidth;
    var H = document.documentElement.clientHeight;
    //调整布局大小
    if (W > 1100 && H > 670) {

        document.getElementById("divWrapper").setAttribute("style", "width: " + document.documentElement.clientWidth + "px;height:" + document.documentElement.clientHeight + "px;")
    } else {
        if (W > 1000) {
            document.getElementById("divWrapper").setAttribute("style", "width: " + W + "px")
        }
        if (H > 670) {
            document.getElementById("divWrapper").setAttribute("style", "height:" + H + "px;")
        }
    }


    //调整布局大小
    // if(document.documentElement.clientWidth>0&&document.documentElement.clientHeight>0){
    //
    // }

}
window.onload = function () {
    // document.getElementById("importDataMain").setAttribute("href", "javascript:onclick=show('importData') ");
    document.getElementById("importDataMain").setAttribute("onclick", "show('importData'); changeWay('importDataMain')");
    document.getElementById("creditScoreMain").setAttribute("onclick", "show('creditScore'); changeWay('creditScoreMain')");
    document.getElementById("academicWarningMain").setAttribute("onclick", "show('academicWarning'); changeWay('academicWarningMain')");
    document.getElementById("systemSettingsMain").setAttribute("onclick", "show('systemSettings'); changeWay('systemSettingsMain')");

    //调整布局大小
    if (document.documentElement.clientWidth > 0 && document.documentElement.clientHeight > 0) {
        document.getElementById("divWrapper").setAttribute("style", "width: " + document.documentElement.clientWidth + "px;height:" + document.documentElement.clientHeight + "px;")
    }


    // var mainLength= document.getElementById("menuMain").getElementsByTagName("li").length;
    // console.log(mainLength);
    //  console.log("+++++");
    // for (var i = 0; i < mainLength; i++) {
    //
    //
    // }


    // alert("已经成功添加事件");
// document.getElementById("changeContent").innerHTML();
    // alert(document.documentElement.clientWidth+":"+document.documentElement.clientHeight);




}

function changeWay(obj) {
    var span=document.getElementById(obj).children[1];
    var style = span.currentStyle || document.defaultView.getComputedStyle(span, '');
    if (style.content.indexOf("down")>=0){
        span.style.setProperty('content','url("resources/images/arrow-up.png")');
    }else {
        span.style.setProperty('content','url("resources/images/arrow-down.png")');
    }

}

function changeView(id) {
    var ob = document.getElementById("contentCHJy");
    ob.src = id;

}

function show(d1) {
    var currentElement = document.getElementById(d1);
    if (currentElement.style.display == 'block') {
        currentElement.style.display = 'none';  //触动的层如果处于显示状态，即隐藏
    }
    else {
        currentElement.style.display = 'block';  //触动的层如果处于隐藏状态，即显示
    }
}


